package com.tangruitao.service.impl;

import com.tangruitao.bean.Detail;
import com.tangruitao.bean.Users;
import com.tangruitao.bean.Zhuce;
import com.tangruitao.dao.ZhuceDao;
import com.tangruitao.service.ZhuceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 这个类的作者是13536
 * 开发日期:2021/12/27
 **/
@Service
public class ZhuceServiceImpl implements ZhuceService {
    @Autowired
    ZhuceDao zhuceDao;
    @Override
    public Integer insertZhuce(Zhuce zhuce) {
//        注册表增加
        Integer i = zhuceDao.insertZhuce(zhuce);
        Users users = new Users(zhuce.getZhanghao(), zhuce.getPassword());
//        增加用户表
          i+= zhuceDao.insertuser(users);
        return i;
    }

    @Override
    public Integer insertuser(Users users) {
        return zhuceDao.insertuser(users);
    }

    @Override
    public Users selectUserByName(String name) {
        return zhuceDao.selectUserByName(name);
    }

    @Override
    public Integer insertDatil(Detail detail) {
        return zhuceDao.insertDatil(detail);
    }

    @Override
    public Zhuce selectZhuceByUid(String name) {
        return zhuceDao.selectZhuceByUid(name);
    }
}
